package org.shareworth.online_life.client;

import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.util.IconHelper;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.util.Scroll;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.TabItem;
import com.extjs.gxt.ui.client.widget.TabPanel;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;

public class MainLayout extends Viewport {

	private TabPanel tabPanel ;
	public MainLayout() {
		BorderLayout bl = new BorderLayout();
		this.setLayout(bl);
		initLayoutCenter();
		
		this.add(tabPanel, centerData());
	}

	private void initLayoutCenter(){
		tabPanel = new TabPanel();
		TabItem pti = new TabItem("首页");
		//pti.setIconStyle("setting-icon");
		pti.setClosable(true);
		pti.setUrl("http://www.google.cn");
		tabPanel.setBounds(10, 10, 300, 300);
		tabPanel.add(pti);
	}
	private BorderLayoutData leftData() {
		BorderLayoutData ld = new BorderLayoutData(LayoutRegion.WEST, 150);
		ld.setCollapsible(true);
		ld.setFloatable(true);
		ld.setSplit(true);
		ld.setMargins(new Margins(5, 0, 5, 5));
		return ld;
	}

	private BorderLayoutData centerData() {
		BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
		centerData.setMargins(new Margins(5));
		centerData.setFloatable(false);
	
		
		return centerData;
	}
	private BorderLayoutData topData() {
		BorderLayoutData topData = new BorderLayoutData(LayoutRegion.NORTH,
				30);
		topData.setMargins(new Margins(5,5,0,5));
		
		return topData;
	}
}
